package com.xhf.kl;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.TypedValue;
import android.view.Window;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.xhf.kl.utils.DensityUtils;
import com.xhf.kl.utils.StatusBarCompat;

/**
 * Created by Administrator on 2017/9/30.
 */

public class SetActivity extends AppCompatActivity {
    private RelativeLayout rl_one,rl_two,rl_three,rl_four;
    private TextView tv_one,tv_two,tv_three,tv_four,tv_test,tv_sure,tv_cancle;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        supportRequestWindowFeature(Window.FEATURE_NO_TITLE);// 无标题
        setContentView(R.layout.activity_set);
        StatusBarCompat.translucentStatusBar(this);//沉浸状态栏
        rl_one= (RelativeLayout) findViewById(R.id.rl_one);
        rl_two= (RelativeLayout) findViewById(R.id.rl_two);
        rl_three= (RelativeLayout) findViewById(R.id.rl_three);
        rl_four= (RelativeLayout) findViewById(R.id.rl_four);
        LinearLayout.LayoutParams linearParams =(LinearLayout.LayoutParams) rl_one.getLayoutParams();
        linearParams.width = DensityUtils.getScreenWidth(SetActivity.this)/4*3;
        rl_one.setLayoutParams(linearParams); //动态设置大小
        rl_two.setLayoutParams(linearParams); //动态设置大小
        rl_three.setLayoutParams(linearParams); //动态设置大小
        rl_four.setLayoutParams(linearParams); //动态设置大小


        tv_one= (TextView) findViewById(R.id.tv_one);
        tv_one.setTextSize(TypedValue.COMPLEX_UNIT_SP, DensityUtils.px2sp(SetActivity.this,60));
        tv_two= (TextView) findViewById(R.id.tv_two);
        tv_two.setTextSize(TypedValue.COMPLEX_UNIT_SP, DensityUtils.px2sp(SetActivity.this,60));
        tv_three= (TextView) findViewById(R.id.tv_three);
        tv_three.setTextSize(TypedValue.COMPLEX_UNIT_SP, DensityUtils.px2sp(SetActivity.this,60));
        tv_four= (TextView) findViewById(R.id.tv_four);
        tv_four.setTextSize(TypedValue.COMPLEX_UNIT_SP, DensityUtils.px2sp(SetActivity.this,60));
        tv_test= (TextView) findViewById(R.id.tv_test);
        tv_test.setTextSize(TypedValue.COMPLEX_UNIT_SP, DensityUtils.px2sp(SetActivity.this,72));
        tv_sure= (TextView) findViewById(R.id.tv_sure);
        tv_sure.setTextSize(TypedValue.COMPLEX_UNIT_SP, DensityUtils.px2sp(SetActivity.this,48));
        tv_cancle= (TextView) findViewById(R.id.tv_cancle);
        tv_cancle.setTextSize(TypedValue.COMPLEX_UNIT_SP, DensityUtils.px2sp(SetActivity.this,48));
    }
}
